package me.zk.practice1.hw;

import java.util.Arrays;
import java.util.Scanner;

public class HWBJ11 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        String s = scanner.nextLine();

        int[] m = Arrays.stream(s.split(" ")).mapToInt(Integer::parseInt).toArray();

        int sum = 0;
        for(int r : m) {
            sum+=r;
        }
        int i =1;
        int[] res = new int[m.length];
        while (sum  > 0) {
            if (i%7 == 0 || String.valueOf(i).contains("7")) {
                res[(i-1)%m.length]++;
                sum--;

            }
            i++;

        }
        System.out.println(Arrays.toString(res));

    }
}
